#include <bits/stdc++.h>

using namespace std;





struct ListNode {
    int val;
    ListNode *next;
    ListNode(int x) : val(x), next(NULL) {}
};

class Solution {
public:
    ListNode* getKthFromEnd(ListNode* head, int k) {
        if(nullptr==head||k<=0) return nullptr;
        ListNode *p=head,*q=head;
        while( k--){
            p=p->next;
        }
        while(p){
            p=p->next;
            q=q->next;
        }
        return q;
    }
};
int main(){




    return 0;
}